package base;


/**
 * 原本的工厂模式
 *
 * @author Seon
 * @date 2022/10/28 16:25
 */
public class CashFactory {
    public static BaseCashStrategy createCashStrategy(int type) {
        return switch (type) {
            case 1 -> new CashReturn(300, 100);
            case 2 -> new CashRebate(0.8);
            default -> new CashNormal();
        };
    }
}
